# -*- coding: utf-8 -*-#
# ----------------------------------------*_*
# Author:       Chasetity
# Date:         2021/6/28
# ----------------------------------------*_*

import requests
from urllib.parse import urljoin

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
}
url = 'http://localhost/'
index_path = urljoin(url,'/shopxo/index.php?s=/index/user/login.html')
data = {
    "accounts":'admin',
    "pwd":'123456',
    "type":'username',
}
response = requests.Session().post(url=index_path,data=data,headers=headers)
try:
    print(response.json().get('msg'))
except:
    print(response.text)
